using System;
using System.Windows.Forms;
using System.Drawing;

namespace HIS
{
    public class InternForm : Form
    {
        private TextBox txtInternInfo;
        private DataGridView dgvPermission;
        private DataGridView dgvOperationLog;

        public InternForm()
        {
            InitializeComponents();
        }

        private void InitializeComponents()
        {
            // 窗体设置
            this.Text = "实习生管理";
            this.Size = new Size(800, 600);
            this.StartPosition = FormStartPosition.CenterScreen;

            // 实习生信息录入区域
            GroupBox gbInternInfo = new GroupBox
            {
                Text = "实习生信息",
                Location = new Point(10, 10),
                Size = new Size(780, 100)
            };

            txtInternInfo = new TextBox
            {
                Location = new Point(10, 25),
                Size = new Size(760, 65),
                Multiline = true
            };

            gbInternInfo.Controls.Add(txtInternInfo);

            // 实习生权限设置区域
            GroupBox gbPermission = new GroupBox
            {
                Text = "权限设置",
                Location = new Point(10, 120),
                Size = new Size(780, 200)
            };

            dgvPermission = new DataGridView
            {
                Location = new Point(10, 25),
                Size = new Size(760, 165),
                AllowUserToAddRows = false,
                AllowUserToDeleteRows = false,
                ReadOnly = false,
                SelectionMode = DataGridViewSelectionMode.FullRowSelect
            };

            // 添加列
            dgvPermission.Columns.AddRange(new DataGridViewColumn[] {
                new DataGridViewCheckBoxColumn { Name = "选择", HeaderText = "选择", Width = 50 },
                new DataGridViewTextBoxColumn { Name = "功能模块", HeaderText = "功能模块", Width = 200 },
                new DataGridViewTextBoxColumn { Name = "权限说明", HeaderText = "权限说明", Width = 300 },
                new DataGridViewTextBoxColumn { Name = "状态", HeaderText = "状态", Width = 100 }
            });

            gbPermission.Controls.Add(dgvPermission);

            // 实习生操作记录显示区域
            GroupBox gbOperationLog = new GroupBox
            {
                Text = "操作记录",
                Location = new Point(10, 330),
                Size = new Size(780, 260)
            };

            dgvOperationLog = new DataGridView
            {
                Location = new Point(10, 25),
                Size = new Size(760, 225),
                AllowUserToAddRows = false,
                AllowUserToDeleteRows = false,
                ReadOnly = true,
                SelectionMode = DataGridViewSelectionMode.FullRowSelect
            };

            // 添加列
            dgvOperationLog.Columns.AddRange(new DataGridViewColumn[] {
                new DataGridViewTextBoxColumn { Name = "操作时间", HeaderText = "操作时间", Width = 150 },
                new DataGridViewTextBoxColumn { Name = "操作模块", HeaderText = "操作模块", Width = 150 },
                new DataGridViewTextBoxColumn { Name = "操作内容", HeaderText = "操作内容", Width = 300 },
                new DataGridViewTextBoxColumn { Name = "操作结果", HeaderText = "操作结果", Width = 100 }
            });

            gbOperationLog.Controls.Add(dgvOperationLog);

            // 添加控件到窗体
            this.Controls.AddRange(new Control[] {
                gbInternInfo,
                gbPermission,
                gbOperationLog
            });
        }
    }
} 